package auth_service

import (
	"go_api/models/ucenter"
)

type Auth struct {
	UID					int
	Username 			string
}

func (a *Auth) GetOneMember() (error, *ucenter.UCMember) {
	return ucenter.GetOneMember(a.getMaps())
}

func (a *Auth) getMaps() map[string]interface{} {
	maps := make(map[string]interface{})
	if a.UID > 0 {
		maps["uid"] = a.UID
	}
	if a.Username != "" {
		maps["username"] = a.Username
	}

	return maps
}
